package com.desire.homework;

import java.time.DayOfWeek;
import java.time.LocalDate;

/**
 * @author LittleDesire
 * @description
 * @date 2022-02-10 周四 20:01
 * @since 17
 */
public class _56_显示星期几 {
    public static void main(String[] args) {
//显示当前日期星期几 java.time.DayOfWeek 类
        var d5 = LocalDate.now().getDayOfWeek();
        System.out.println(d5);//TUESDAY
        DayOfWeek dw = LocalDate.now().getDayOfWeek();
//Returns: //the day-of-week, from 1 (Monday) to 7 (Sunday)
        System.out.println(dw.getValue());
        System.out.printf("%s 是：星期%s %n", LocalDate.now(), "一二三四五六日".charAt(dw.getValue() - 1));
    }
}
